home *** CD-ROM | disk | FTP | other *** search
/ Windows News 2006 October / wn148cd2.iso / Windows / Travailler / QuickZip / quickzip_460013.exe / {app} / Scripts / File / Akp Pack and Date.akp < prev    next >
Text File  |  2004-01-01  |  983b  |  34 lines

  1. var yy, mm, dd : word;
  2.     mmm,ddd : string;
  3.     i : integer;
  4. function RemoveSlash(Input: string): string;
  5. begin
  6.   if Input <> '' then
  7.     if Input[Length(Input)] = '\' then
  8.       Result := Copy(Input, 0, Length(Input) - 1)
  9.     else
  10.       Result := Input;
  11. end;
  12. function removefileext(input : string) : string;
  13. var
  14.   I: Integer;
  15. begin
  16.   I := LastDelimiter('.\:', input);
  17.   if (I > 0) and (input[I] = '.') then
  18.     Result := Copy(input, 0, i-1) else
  19.     Result := input;
  20. end;
  21. begin
  22. Decodedate(now,yy,mm,dd);
  23. if mm < 10 then mmm := '0' + inttostr(mm) else mmm := inttostr(mm);
  24. if dd < 10 then ddd := '0' + inttostr(dd) else ddd := inttostr(dd);
  25. if pos('*',Param.strings[0]) > 1 then //Directory
  26. New(RemoveSlash(Extractfilepath(Param.strings[0])) + '_' +
  27.        mmm + ddd + inttostr(yy)+'.zip') else
  28. New(Removefileext(Param.strings[0]) + '_' +
  29.        mmm + ddd + inttostr(yy)+'.zip');
  30. for i := 0 to Param.count -1 do
  31.   Add(Param.strings[i]);
  32. Doadd;
  33. end.
  34.